<?php
namespace app\admin\validate;

use think\Validate;

/**
 * 管理员验证器
 * Class AdminUser
 * @package app\admin\validate
 */
class Kefu extends Validate
{
    protected $rule = [
        'username'         => 'require|unique:kefu',
        'username'         => ['regex' => '/^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/'],
        'password'         => 'confirm:confirm_password',
        'confirm_password' => 'confirm:password',
        'status'           => 'require',
    ];

    protected $message = [
        'username.require'         => '请输入手机号',
        'username.unique'          => '手机号已存在',
        'username.regex'           => '请输入正确手机号',
        'password.confirm'         => '两次输入密码不一致',
        'confirm_password.confirm' => '两次输入密码不一致',
        'status.require'           => '请选择状态',
    ];
}